// const path = require("path");
module.exports = {
	publicPath: process.env.NODE_ENV === 'production' ? '/public/static' : '/',
    chainWebpack: config => {
        const oneOfsMap = config.module.rule('scss').oneOfs.store
        oneOfsMap.forEach(item => {
            item
                .use('sass-resources-loader')
                .loader('sass-resources-loader')
                .options({
                    // 要公用的scss的路径
                    resources: './src/assets/scss/global.scss'
                })
                .end()
        })
        config.plugin('html').tap((args) => {
            args[0].title = '电商平台';
            return args;
        })
    },
    devServer: {
        port: 8080,
        proxy: {
          '/api': {
            target:'http://127.0.0.1:8888',
            // secure: false, // 如果是https接口，需要配置这个参数
            changeOrigin:true,
            pathRewrite:{
              '^/api': '/api'
            }
          }
        },
    }
}